//
//  HGMusicHeaderCollectionReusableView.m
//  悦享
//
//  Created by dllo on 16/3/21.
//  Copyright © 2016年 张洪国. All rights reserved.
//

#import "HGMusicHeaderCollectionReusableView.h"

@implementation HGMusicHeaderCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.label2 = [[UILabel alloc] init];
        [self addSubview:_label2];
       
        
        self.label1 = [[UILabel alloc] init];
        [self addSubview:_label1];
        
        
        self.moreButon = [UIButton buttonWithType:UIButtonTypeCustom];
        
        [self addSubview:_moreButon];
        
        self.view1 = [[UIView alloc] init];
        [self addSubview:_view1];
        
    }
    return self;
}

- (void)setModel:(HGMusicModel *)model{
    _model = model;
    if ([_model.name isEqualToString:@"大家在听"]) {
        _label1.text = _model.name;
        _label2.text = _model.desc;
        _label2.frame = CGRectMake(85, 10, 80, 20);
        _label2.font = [UIFont systemFontOfSize:10];
        _label2.textColor = [UIColor lightGrayColor];
    }else{
        _label1.text = [NSString stringWithFormat:@"%@", _model.name];
        
    }
   
   
    
    
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    
        _label1.frame = CGRectMake(10, 5, 200, 30);
        _label1.textColor = [UIColor blackColor];
        _label1.font = [UIFont systemFontOfSize:15];
   
    _moreButon.frame = CGRectMake((SREEN_WIDTH - 60), 5, 60, 20);
    _moreButon.titleLabel.font = [UIFont systemFontOfSize:14];
    _moreButon.titleLabel.textColor = [UIColor blueColor];
    
    _view1.frame = CGRectMake(10, 30, SREEN_WIDTH - 20, 1);
    _view1.backgroundColor = [UIColor lightGrayColor];
}
@end
